#include <iostream>
#include <string.h>
using namespace std;
//继承的好处:减少重复代码
//语法:class 子类 : 继承方式 父类
//子类 也成为 派生类
//父类 也成为 基类
class BasePage{
public:
    void Toptitle(){
        cout << "this is toptitle" << endl;
    }
};

class Python : public BasePage {
public:
    void content(){
        cout << "this is python" << endl;
    }
};

class CPP : public BasePage {
public:
    void content(){
        cout << "this is C++" << endl;
    }
};

void test01(){
    CPP cpp;
    cpp.Toptitle();
    cpp.content();
    Python py;
    py.Toptitle();
    py.content();
}

int main(){
    test01();
    system("pause");
    return 0;
}